# -*- coding: utf-8 -*-

from django.utils.translation import ugettext as _
#from django.forms.extras.widgets import SelectDateWidget

from django import forms

from mediabox.lira.models import Topic
from mediabox.lira.models import Region
from mediabox.lira.models import Program
from mediabox.lira.models import Document

CONTENT_TYPES = (
    ("video", _("Video")),
    ("picture", _("Picture")),
    ("document", _("Document")),
    ("others", _("Others")),
)

class DocumentForm(forms.ModelForm):
    class Meta:
        app_label = 'lira'
        model = Document

        widgets = {
            'title': forms.TextInput(attrs={ 'class': 'text mid', }),
            'description': forms.Textarea(attrs={ 'class': 'wysiwyg', }),
            'program': forms.Select(attrs={ 'class': 'chzn-select', }),
            'topic': forms.Select(attrs={ 'class': 'chzn-select', }),
            'region': forms.Select(attrs={ 'class': 'chzn-select', }),
            'item_type': forms.Select(attrs={ 'class': 'chzn-select', }),
            'created': forms.TextInput(attrs={ 'class': 'text date_picker', }),
            'tags': forms.TextInput(attrs={ 'class': 'text mid', }),
            'announce': forms.CheckboxInput(attrs={ 'class': 'checkbox', })
        }

class ProgramForm(forms.ModelForm):
    class Meta:
        app_label = 'lira'
        model = Program

        widgets = {
            'title': forms.TextInput(attrs={ 'class': 'text', }),
            'description': forms.Textarea(attrs={ 'class': 'text small', 'rows': 2 }),
        }

class RegionForm(forms.ModelForm):
    class Meta:
        app_label = 'lira'
        model = Region

        widgets = {
            'region_name': forms.TextInput(attrs={ 'class': 'text', }),
        }

class TopicForm(forms.ModelForm):
    class Meta:
        app_label = 'lira'
        model = Topic

        widgets = {
            'title': forms.TextInput(attrs={ 'class': 'text', }),
            'description': forms.Textarea(attrs={ 'class': 'text small', 'rows': 2 }),
        }

class UploadForm(forms.Form):
    upload = forms.FileField(max_length=255, widget=forms.FileInput(attrs={ 'id': 'fileupload', }))

    class Meta:
        app_label = 'lira'
